package com.zhiwei.msf.common.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author ZHIWEI.YANG
 * @createtime 2019/2/1 - 16:39
 * @decription 自定义异常
 **/
@Data
@EqualsAndHashCode(callSuper = true)
public class BasePublishException extends RuntimeException {

    private static final long serialVersionUID = -7743112276731536325L;

	/**
     * 异常码
     */
    private String code;

    private Object[] args;

    public BasePublishException(String errorCode) {
        this.code = errorCode;
    }

    public BasePublishException(String errorCode, Object[] args) {
        this.code = errorCode;
        this.args = args;
    }

    public BasePublishException(String code, String msg) {
        super(msg);
        this.code = code;
    }

    public BasePublishException(String code, String msg, Object[] args) {
        super(msg);
        this.code = code;
        this.args = args;
    }

    public BasePublishException(String msg, Exception e) {
        super(msg, e);
    }
}
